<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;
            height: 300px;
            border: 1px solid #ddd;
            margin: auto;
            text-align: center;
            padding-top: 10px;
        }
        .box1{
            width: 150px;
            height: 150px;
            border: 1px solid #ddd;
            margin: auto;
            margin-top: 50px;
            background-color: black;

        }
    </style>
</head>
<body>
       <div class="box">
        <input type="button" value="变高" onclick="c_height()"/>
        <input type="button" value="变宽" onclick="c_width()"/>
        <input type="button" value="变色" onclick="c_color()"/>
        <input type="button" value="隐藏" onclick="c_hide()"/>
        <input type="button" value="重置" onclick="c_reset()"/>

        <div class="box1">
            
        </div>

       </div>
</body>
</html>
<script type="text/javascript">
   var box2=document.querySelector(".box1")
   function c_height(){
       box2.style.height="200px"
   }
   function c_width(){
       box2.style.width="200px"
   }
   function c_color(){
       box2.style.backgroundColor="red"
   }
   function c_hide(){
       box2.style.visibility="hidden"
   }
   function c_reset(){
       box2.style.cssText="background-color:black; width:150px;height:150px"
   }
</script>